
package org.upt.dcda.db;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The persistent class for the tags database table.
 * 
 */
@Entity
@Table(name = "tags")
@NamedQuery(name = TagEntity.VIEW_ALL_TAGS, query = "SELECT tagm FROM TagEntity tagm")
public class TagEntity implements Serializable
{

	public static final String	VIEW_ALL_TAGS		= "view_all_tags";

	private static final long	serialVersionUID	= 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "tag_id")
	private int					tagId;

	@Column(name = "tag_name")
	private String				tagName;

	@OneToMany(mappedBy = "tag")
	private Set<BookTagEntity>	booktags;

	public TagEntity()
	{
	}

	public int getTagId()
	{
		return this.tagId;
	}

	public void setTagId(int tagId)
	{
		this.tagId = tagId;
	}

	public String getTagName()
	{
		return this.tagName;
	}

	public void setTagName(String tagName)
	{
		this.tagName = tagName;
	}

	// bi-directional many-to-one association to BookTagEntity
	public Set<BookTagEntity> getBooktags()
	{
		return this.booktags;
	}

	public void setBooktags(Set<BookTagEntity> booktags)
	{
		this.booktags = booktags;
	}

}
